<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>A canvas fontFamily example</title>
 
    <script type="text/xaml" id="xaml"><?xml version="1.0"?>
      <Canvas xmlns="http://schemas.microsoft.com/client/2007"></Canvas></script>
<script type="text/javascript" src="../uupaa-excanvas.js"></script>
 
    <script>
window.onload = function() {
  var layer1 = new uuCanvas.Layer(document.getElementById("view1"), 450, 800);
  var layer2 = new uuCanvas.Layer(document.getElementById("view2"), 450, 800);
  layer1.addCanvas("a").show().setFill("blue").set({textAlign:"center"});
  layer2.addVMLCanvas("a").show().setFill("green").set({textAlign:"center"});

  uuCanvas.ready(function() {
    draw(layer1);
    draw(layer2);
  });
};
function draw(layer) {
  var x = 200, y = 10;
  layer.
    set({ font: "24pt Arial"                 }).text("24pt Arial", x, y).
    set({ font: "24pt 'Arial Black'"         }).text("24pt 'Arial Black'", x, y += 50).
    set({ font: "24pt 'Comic Sans MS'"       }).text("24pt 'Comic Sans MS'", x, y += 50).
    set({ font: "24pt 'Courier New'"         }).text("24pt 'Courier New'", x, y += 50).
    set({ font: "24pt 'Lucida Grande'"       }).text("24pt 'Lucida Grande'", x, y += 50).
    set({ font: "24pt 'Lucida Sans Unicode'" }).text("24pt 'Lucida Sans Unicode'", x, y += 50).
    set({ font: "24pt 'Times New Roman'"     }).text("24pt 'Times New Roman'", x, y += 50).
    set({ font: "24pt 'Trebuchet MS'"        }).text("24pt 'Trebuchet MS'", x, y += 50).
    set({ font: "24pt Verdana"               }).text("24pt Verdana", x, y += 50).
    set({ font: "24pt helvetica"             }).text("24pt helvetica", x, y += 50).
    set({ font: "24pt HiraKakuPro-W3"        }).text("24pt HiraKakuPro-W3", x, y += 50).
    set({ font: "24pt 'MS UI Gothic'"        }).text("24pt 'MS UI Gothic'", x, y += 50).
    set({ font: "24pt 'MS PGothic'"          }).text("24pt 'MS PGothic'", x, y += 50).
    set({ font: "24pt 'メイリオ'"            }).text("24pt 'メイリオ'", x, y += 50).
    set({ font: "24pt hoge,impact"           }).text("24pt hoge,impact", x, y += 50);
}
    </script>
    <style type="text/css">
      body { margin: 20px; font-family: arial,verdana,helvetica; background: #fff;}
      h1 { font-size: 140%; font-weight:normal; color: #036; border-bottom: 1px solid #ccc; }
      canvas { border: 2px solid #000; float: left; margin-right: 20px; margin-bottom: 20px; }
      pre { float:left; display:block; background: rgb(238,238,238); border: 1px dashed #666; padding: 15px 20px; margin: 0 0 10px 0; }
    </style>
  </head>
  <body>
    <h1>A canvas <code>fontFamily</code> example</h1>
    <div>
      <table>
      <tr><td><div id="view1"></div></td><td><div id="view2"></div></td></tr>
      </table>
      <pre>
&lt;div id="view1"&gt;&lt;/div&gt;
&lt;div id="view2"&gt;&lt;/div&gt;

window.onload = function() {
  var layer1 = new uuCanvas.Layer(document.getElementById("view1"), 450, 800);
  var layer2 = new uuCanvas.Layer(document.getElementById("view2"), 450, 800);
  layer1.addCanvas("a").show().setFill("blue").set({textAlign:"center"});
  layer2.addVMLCanvas("a").show().setFill("green").set({textAlign:"center"});

  uuCanvas.ready(function() {
    draw(layer1);
    draw(layer2);
  });
};
function draw(layer) {
  var x = 200, y = 10;
  layer.
    set({ font: "24pt Arial"                 }).text("24pt Arial", x, y).
    set({ font: "24pt 'Arial Black'"         }).text("24pt 'Arial Black'", x, y += 50).
    set({ font: "24pt 'Comic Sans MS'"       }).text("24pt 'Comic Sans MS'", x, y += 50).
    set({ font: "24pt 'Courier New'"         }).text("24pt 'Courier New'", x, y += 50).
    set({ font: "24pt 'Lucida Grande'"       }).text("24pt 'Lucida Grande'", x, y += 50).
    set({ font: "24pt 'Lucida Sans Unicode'" }).text("24pt 'Lucida Sans Unicode'", x, y += 50).
    set({ font: "24pt 'Times New Roman'"     }).text("24pt 'Times New Roman'", x, y += 50).
    set({ font: "24pt 'Trebuchet MS'"        }).text("24pt 'Trebuchet MS'", x, y += 50).
    set({ font: "24pt Verdana"               }).text("24pt Verdana", x, y += 50).
    set({ font: "24pt helvetica"             }).text("24pt helvetica", x, y += 50).
    set({ font: "24pt HiraKakuPro-W3"        }).text("24pt HiraKakuPro-W3", x, y += 50).
    set({ font: "24pt 'MS UI Gothic'"        }).text("24pt 'MS UI Gothic'", x, y += 50).
    set({ font: "24pt 'MS PGothic'"          }).text("24pt 'MS PGothic'", x, y += 50).
    set({ font: "24pt 'メイリオ'"            }).text("24pt 'メイリオ'", x, y += 50).
    set({ font: "24pt hoge,impact"           }).text("24pt hoge,impact", x, y += 50);
}
      </pre>
    </div>
  </body>
</html>
 

